------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\data\UI_2020\logs\UI-rep_NPN.log
  log type:  text
 opened on:  26 Mar 2024, 13:29:11

. *************************************************************************
. * Created by:   Rob Valletta                                            
. * Created on:   05/19/2022
. * Description:  List tabulations of UI_rep distribution by occ and ind
. * Modified on:  3/26/24 (RV): Simplify and illustrate for NPN calculations
. *               (using majocc, data includes full occ variable)
. *************************************************************************
. 
. version 15

. clear *

. set more off

. capture program drop _all

. cd C:\data\UI_2020
C:\data\UI_2020

. set linesize 240

. 
. ** Pull in analysis extract 
. use data\CPS_2020_unbalanced_v2.dta, clear

. 
. ** FORM UI REPLACEMENT RATE (WITH $600 SUPP), DROP 0'S and DC
. gen UI_rep=(UI_CARES/weekly_earnings)
(154,722 missing values generated)

.   replace UI_rep=0 if UI_rep==.
(154,722 real changes made)

. drop if UI_rep==0
(163,890 observations deleted)

. drop if st=="DC"
(0 observations deleted)

. 
. ** SET NEG MAJOCC TO MISSING
. replace majind=. if majind<=0
(9,213 real changes made, 9,213 to missing)

. replace majocc=. if majocc<=0
(9,213 real changes made, 9,213 to missing)

. 
. ** Label majocc variable
. #d ;
delimiter now ;
. label define occ 1 "Manag" 2 "Prof_tech" 3 "Services" 4 "Sales" 5 "Admin" 6 "Farm_Fish"
> 7 "Const_Extract" 8 "Inst_Maint_Rep" 9 "Production" 10 "Trans_Materials" 11 "Armed_Forces";

. #d cr
delimiter now cr
. label values majocc occ

. label variable majocc "Major occupation recode"

. 
. ** RESTRICT TO UNEMPLOYED
. keep if U==1
(168,984 observations deleted)

. 
. 
. ** DO TABULATIONS OF REP RATE
. ** Overall
. summ UI_rep* if (UI_rep>0) [aw=wgtbls], det

                           UI_rep
-------------------------------------------------------------
      Percentiles      Smallest
 1%     .2453333       .0495419
 5%      .441376       .0496364
10%     .5934118       .0496364       Obs               8,894
25%        .9568       .0514694       Sum of wgt.    29492545

50%     1.377143                      Mean           1.523892
                        Largest       Std. dev.      .9151633
75%     1.856962       11.37017
90%     2.516133       11.37017       Variance       .8375238
95%          3.1       14.33333       Skewness       2.561432
99%      4.84968       14.33333       Kurtosis       18.98862

. ** April 2020-forward only
. summ UI_rep* if (UI_rep>0  & month>3) [aw=wgtbls], det

                           UI_rep
-------------------------------------------------------------
      Percentiles      Smallest
 1%     .2482764       .0496364
 5%         .455       .0496364
10%        .6253       .0514694       Obs               6,610
25%          .98       .0514694       Sum of wgt.  22473493.1

50%     1.392857                      Mean           1.548128
                        Largest       Std. dev.      .9205565
75%     1.876522       11.37017
90%         2.52       11.37017       Variance       .8474244
95%          3.1       14.33333       Skewness       2.743161
99%      4.84968       14.33333       Kurtosis       21.42912

. 
. ** Set up table by majocc
.   ** Form uniform row variable
. gen all=1

.   ** Majocc
. table all majocc [aw=wgtbls], c(mean UI_rep sd UI_rep n UI_rep) col format(%4.3f)

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
          |                                                                                          Major occupation recode                                                                                          
      all |           Manag        Prof_tech         Services            Sales            Admin        Farm_Fish    Const_Extract   Inst_Maint_Rep       Production  Trans_Materials     Armed_Forces            Total
----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        1 |           1.069            1.389            1.810            1.702            1.681            1.609            1.204            1.344            1.319            1.536            1.152            1.523
          |           0.630            1.016            0.960            1.012            0.889            0.612            0.574            0.670            0.533            0.922            0.395            0.915
          |         860.000         1484.000         2148.000          965.000          842.000           74.000          709.000          275.000          626.000          874.000           18.000         8875.000
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

. 
. keep UI* month weekly_earnings occ majocc wgtbls

. save data\CPS-2020_ASEC-monthly_for-NPN, replace
file data\CPS-2020_ASEC-monthly_for-NPN.dta saved

. summ

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
         occ |      8,894    4774.613    2540.962         -1       9840
       month |      8,894    4.050483    1.337062          1          7
      wgtbls |      8,894    3316.005    1922.342   151.2965   17237.04
      majocc |      8,875    4.565746    2.866152          1         11
weekly_ear~s |      8,894    962.3493    1102.211         45   21153.83
-------------+---------------------------------------------------------
          UI |      8,894    331.1892    147.6395         15        823
    UI_CARES |      8,894    931.1892    147.6395        615       1423
      UI_rep |      8,894    1.520754    .9669118   .0495419   14.33333

. 
. log close
      name:  <unnamed>
       log:  C:\data\UI_2020\logs\UI-rep_NPN.log
  log type:  text
 closed on:  26 Mar 2024, 13:29:11
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
